//
//  SHRWViewController.m
//  VmiSJ
//
//  Created by 汪的一声就哭了！ on 2017/1/6.
//  Copyright © 2017年 汪的一声就哭了！. All rights reserved.
//
#define NavHeight 64
//容器标题高度
#define TitleHeight self.fontSize*3
#import "SHRWViewController.h"

@interface SHRWViewController ()<ChooseVCViewDelegate, SHRWDSHViewControllerDelegate, SHRWSHCGViewControllerDelegate, SHRWSHSBViewControllerDelegate>

@end

@implementation SHRWViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"审核任务";
    self.automaticallyAdjustsScrollViewInsets = NO;
    ChooseVCView *chooseViewC = [[ChooseVCView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-NavHeight) btnArray:@[@"待审核",@"审核成功",@"审核失败"] font:[UIFont systemFontOfSize:self.fontSize] textColor:Color selectedImg:[UIImage imageNamed:@""] aSelectedColor:[UIColor whiteColor] titleRect:CGRectMake(10, 8, WIDTH-20, TitleHeight-16) titleHeight:TitleHeight];
    chooseViewC.backgroundColor = [UIColor whiteColor];
    chooseViewC.delegate = self;
    [self.view addSubview:chooseViewC];
    chooseViewC.headView.layer.borderWidth = 1;
    chooseViewC.headView.layer.borderColor = Color.CGColor;
    chooseViewC.headView.layer.cornerRadius = (TitleHeight-16)/2;
    chooseViewC.imageView.layer.cornerRadius = (TitleHeight-16)/2;
    chooseViewC.imageView.backgroundColor = Color;
    chooseViewC.imageView.clipsToBounds = YES;
}
#pragma mark ----------- 容器代理方法
- (void)chooseVCViewDidChoose:(NSInteger)index and:(UIViewController *)SelViewC
{
    if ([SelViewC isKindOfClass:[SHRWDSHViewController class]]) {
        SHRWDSHViewController *viewC = (SHRWDSHViewController *)SelViewC;
        viewC.state = @"1";
    }
    if ([SelViewC isKindOfClass:[SHRWSHCGViewController class]]) {
        SHRWSHCGViewController *viewC = (SHRWSHCGViewController *)SelViewC;
        viewC.state = @"1";
    }
    if ([SelViewC isKindOfClass:[SHRWSHSBViewController class]]) {
        SHRWSHSBViewController *viewC = (SHRWSHSBViewController *)SelViewC;
        viewC.state = @"1";
    }
}
- (UIViewController *)chooseVCViewForSelectedAt:(NSInteger)atIndex
{
    if (atIndex == 0) {
        SHRWDSHViewController *viewC = [[SHRWDSHViewController alloc] init];
        viewC.task_id = self.task_id;
        viewC.delegate = self;
        return viewC;
    }
    else if (atIndex == 1) {
        SHRWSHCGViewController *viewC = [[SHRWSHCGViewController alloc] init];
        viewC.task_id = self.task_id;
        viewC.delegate = self;
        return viewC;
    }
    else {
        SHRWSHSBViewController *viewC = [[SHRWSHSBViewController alloc] init];
        viewC.task_id = self.task_id;
        viewC.delegate = self;
        return viewC;
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark ---------- 代理方法
- (void)SHRWDSHViewControllerDidSelectWithInt:(NSInteger)inte andImgArray:(NSArray *)arr
{
    ImageViewController *viewC = [[ImageViewController alloc] init];
    viewC.weizhiInt = inte;
    viewC.imageArr = arr;
    viewC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentViewController:viewC animated:YES completion:nil];
}
- (void)SHRWSHCGViewControllerDidSelectWithInt:(NSInteger)inte andImgArray:(NSArray *)arr
{
    ImageViewController *viewC = [[ImageViewController alloc] init];
    viewC.weizhiInt = inte;
    viewC.imageArr = arr;
    viewC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentViewController:viewC animated:YES completion:nil];
}
- (void)SHRWSHSBViewControllerDidSelectWithInt:(NSInteger)inte andImgArray:(NSArray *)arr
{
    ImageViewController *viewC = [[ImageViewController alloc] init];
    viewC.weizhiInt = inte;
    viewC.imageArr = arr;
    viewC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentViewController:viewC animated:YES completion:nil];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
